Re: [GENERAL] PL/pgSQL - mailng list - Mailing list pgsql-general

From Stuart Rison
Subject Re: [GENERAL] PL/pgSQL - mailng list
Date
Msg-id v04020a0db36f1e7b3661@[128.40.242.190]
Whole thread Raw
In response to Re: [GENERAL] PL/pgSQL - mailng list  (Chris Bitmead <chris.bitmead@bigfoot.com>)
List pgsql-general
That's an example of performing procedural tasks using Perl as the
procedural language with access to the database.

I think what Mike is looking for are examples of using PL/pgSQL.  Which, as
it where, is a procedural language 'internal' to postgreSQL (well that a
very bad way of putting it but I think you catch my drift).

Plenty of examples of using PL/pgSQL in the docs (as previously pointed
out).  I started by looking at:

http://www.postgresql.org/docs/programmer/xplang1290.htm

and at the plpgsql.txt readme which can be found in the 'source' at:
<source_directory>/src/pl/plpgsql/doc

Stuart.

>It's extremely straight-forward..
>$q = $dbh->prepare("SELECT x,y,z from b where c = ?");
>$q->execute("foo");
>while (($x, $y, $z) = $q->fetchrow())) {
> #stuff
>}
>
>$q = $dbh->prepare("INSERT INTO a(x,y,z) values(?,?,?);
>$q->execute($x,$y,$z);
>
>Mike Haberman wrote:
>>
>> I too need more info on PL/pgSQL than the docs supply.
>>
>> Is it possible for people to mail me any examples of PL/pgSQL.  I
>> just need to see examples of the syntax of the various control
>> sturctures, variable assignment, and the like.
>>
>> >From simple to very complex, send anything that might be helpful.
>>
>> thanks a ton
>>
>> mike haberman
>> mikeh@ncsa.uiuc.edu
>>
>> >
<snip>
>> >
>
>--
>Chris Bitmead
>http://www.bigfoot.com/~chris.bitmead
>mailto:chris.bitmead@bigfoot.com

+-------------------------+--------------------------------------+
| Stuart Rison            | Ludwig Institute for Cancer Research |
+-------------------------+ 91 Riding House Street               |
| Tel. (0171) 878 4041    | London, W1P 8BT, UNITED KINGDOM.     |
| Fax. (0171) 878 4040    | stuart@ludwig.ucl.ac.uk              |
+-------------------------+--------------------------------------+

pgsql-general by date:

Previous
From: "Brett W. McCoy"
Date:
Subject: Re: [GENERAL] Full Text Searches
Next
From:
Date:
Subject: Undeliverable Message